//
//  ZTHomePzgeViewController.m
//  zhibo8
//
//  Created by zzt on 16/11/19.
//  Copyright © 2016年 zzt. All rights reserved.
//

#import "ZTHomePzgeViewController.h"
#import "UIBarButtonItem+Item.h"
#import "ZTNavigationViewController.h"
#import <RESideMenu.h>
//要添加的标题
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "FourthViewController.h"
#import "FifthViewController.h"
#import "SixthViewController.h"

@interface ZTHomePzgeViewController ()

@end

@implementation ZTHomePzgeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor purpleColor];
    
    //1.设置导航栏
    [self setupNavigationBar];
    
    //2.添加标题view
    [self setupTitleView];
}

#pragma mark - 设置导航栏
- (void)setupNavigationBar {
    
    //left
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"bar_menu"] selImage:[UIImage imageNamed:@"bar_menued"] target:self action:@selector(menu)];
    
    //titleView
    self.navigationItem.title = @"🏀";
}

#pragma mark - 点击菜单
- (void)menu {
    [self.sideMenuViewController presentLeftMenuViewController];
}

#pragma mark - 添加标题view
- (void)setupTitleView {
    // 第一个
    FirstViewController *firstVc = [[FirstViewController alloc] init];
    firstVc.title = @"论坛";
    [self addChildViewController:firstVc];
    
    // 第二个
    SecondViewController *secondVc = [[SecondViewController alloc] init];
    secondVc.title = @"新闻";
    [self addChildViewController:secondVc];
    
    // 第三个
    ThirdViewController *thirdVc = [[ThirdViewController alloc] init];
    thirdVc.title = @"关注";
    [self addChildViewController:thirdVc];
    
    // 第四个
    FourthViewController *fourthVc = [[FourthViewController alloc] init];
    fourthVc.title = @"重要";
    [self addChildViewController:fourthVc];
    
    // 第五个
    FifthViewController *fifthVc = [[FifthViewController alloc] init];
    fifthVc.title = @"全部";
    [self addChildViewController:fifthVc];
    
    // 第六个
    SixthViewController *sixthVc = [[SixthViewController alloc] init];
    sixthVc.title = @"完赛";
    [self addChildViewController:sixthVc];
}
@end
